/**
 * 2016，thor.com，all rights reserved。
 * 
 * Project：		palmmall-core
 * Filename：	SPasswordInfoConverter.java
 * Created：		2016年7月30日
 * Creator：		wolv
 */
package com.thor.palmmall.rest.message.converter;

import org.springframework.core.convert.converter.Converter;

import com.thor.palmmall.rest.message.AMessage;
import com.thor.palmmall.spi.message.SMessage;

/**
 * @author wolv
 *
 */
public class AMessageConverter implements Converter<SMessage, AMessage> {

	public static AMessageConverter getInstance() {
		if (instance == null)
			instance = new AMessageConverter();
		return instance;
	}

	private static AMessageConverter instance;

	private AMessageConverter() {
	}

	@Override
	public AMessage convert(SMessage source) {
		if (source == null)
			return null;

		AMessage target = new AMessage();
		target.setCategory(source.getCategory());
		target.setContent(source.getContent());
		target.setTime(source.getTime());
		target.setTitle(source.getTitle());
		target.setUuid(source.getUuid());

		return target;
	}

}
